package cn.service;

import cn.dao.DownloadDao;
import cn.model.File;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by wsx on 2017/1/16.
 */
@Service
public class DownloadService {

    @Autowired
    private DownloadDao dnloaddao;

    public List<File> getfilelist(){
        List<File> list = dnloaddao.findAll();
        return list;
    }

    public String getfsname(String fnewname){
        List<String> list =  dnloaddao.getfsname(fnewname);
        if(list.size() == 1){
            return list.get(0);
        }else{
            return null;
        }
    }


}
